import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SkNickHeadVO, SkNickHeadForm, SkNickHeadQuery } from '@/api/app/SkNickHead/types';

/**
 * 查询头像昵称库列表
 * @param query
 * @returns {*}
 */

export const listSkNickHead = (query?: SkNickHeadQuery): AxiosPromise<SkNickHeadVO[]> => {
  return request({
    url: '/app/SkNickHead/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询头像昵称库详细
 * @param id
 */
export const getSkNickHead = (id: string | number): AxiosPromise<SkNickHeadVO> => {
  return request({
    url: '/app/SkNickHead/' + id,
    method: 'get'
  });
};

/**
 * 新增头像昵称库
 * @param data
 */
export const addSkNickHead = (data: SkNickHeadForm) => {
  return request({
    url: '/app/SkNickHead',
    method: 'post',
    data: data
  });
};

/**
 * 修改头像昵称库
 * @param data
 */
export const updateSkNickHead = (data: SkNickHeadForm) => {
  return request({
    url: '/app/SkNickHead',
    method: 'put',
    data: data
  });
};

/**
 * 删除头像昵称库
 * @param id
 */
export const delSkNickHead = (id: string | number | Array<string | number>) => {
  return request({
    url: '/app/SkNickHead/' + id,
    method: 'delete'
  });
};
